<template>
  <h1>El-单选组件</h1>
  <!-- 双向绑定后才可以选单选项 label保存当前选项的值 -->
  <el-radio-group v-model="edu">
    <el-radio label="初中">学历:初中</el-radio>
    <el-radio label="高中">学历:高中</el-radio>
    <el-radio label="专科">学历:专科</el-radio>
    <el-radio label="本科">学历:本科</el-radio>
  </el-radio-group>
  <h4>您选择的学历是:{{edu}}</h4>
  <hr>
  <el-radio-group v-model="pr">
    <el-radio-button v-for="p in arr" :label="p.price">{{p.title}}</el-radio-button>
  </el-radio-group>
  <h4>这款酒的价格是:{{pr}}</h4>
</template>
<script setup>
  import {ref} from "vue";
  const edu = ref('专科');
  const arr = ref([
    {title:"五粮液",price:500},
    {title:"茅台",price:2500},
    {title:"汾酒",price:330},
    {title:"梦之蓝",price:368}
  ]);
  const pr = ref(368);
</script>

<style scoped>

</style>